package com.springboot.frame.starter;

import com.springboot.frame.starter.config.WxConfig;
import com.springboot.frame.starter.pay.v2.V2;
import com.springboot.frame.starter.pay.v3.V3;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.stereotype.Component;

/**
 * @author liheng
 * @ClassName WeixinProperties
 * @Description
 * @date 2021-07-28 13:55
 */
@Component
@ConfigurationProperties(prefix = "wx.conf")
public class WeixinProperties extends WxConfig {
    /**
     * 默认开启
     */
    private boolean enabled = true;
    /**
     * 获取 App ID
     *
     * @return App ID
     */
    private String appId;
    /**
     * 获取 Secret
     *
     * @return Secret
     */
    private String secret;
    /**
     * 获取 Mch ID
     *
     * @return Mch ID
     */
    private String mchId;
    /**
     * v2
     */
    @NestedConfigurationProperty
    private V2 v2;
    /**
     * v3
     */
    @NestedConfigurationProperty
    private V3 v3;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    @Override
    public String getAppId() {
        return appId;
    }

    @Override
    public String getSecret() {
        return secret;
    }

    @Override
    public String getMchId() {
        return mchId;
    }

    @Override
    public V2 getV2() {
        return v2;
    }

    public void setV2(V2 v2) {
        this.v2 = v2;
    }

    @Override
    public V3 getV3() {
        return v3;
    }

    public void setV3(V3 v3) {
        this.v3 = v3;
    }
}
